package cn.kgc.news.utils;

import java.util.List;

/**
 * 分页工具
 */
public class PageSupport {
    private int totalCount; //总记录数
    private int totalPages; //总页码
    private int currentPage;    //当前页码
    private int pageSize;   //每页多少条
    private List<?> list;   //分页数据

    public List<?> getList() {
        return list;
    }

    public void setList(List<?> list) {
        this.list = list;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPages() {
        if (totalCount%pageSize==0){
            totalPages=totalCount/pageSize;
        }else {
            totalPages=totalCount/pageSize+1;
        }
        return totalPages;
    }

    public void setTotalPages(int totalPages) {
        this.totalPages = totalPages;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}
